package com.regulareport.framework.config;

import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.AviatorEvaluatorInstance;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @author
 * @create 2025-10-20 14:02
 */
@Configuration

public class AviatorConfig {

    @PostConstruct

    public void init() {

         // 开启表达式缓存，对于频繁执行的表达式可提高效率


        AviatorEvaluatorInstance instance = AviatorEvaluator.newInstance();
        instance.setCachedExpressionByDefault(true);
        // 注册自定义函数

//        AviatorEvaluator.addFunction(new CustomFunction());

    }

}
